package me.biezhi.weixin;

import java.io.UnsupportedEncodingException;

import me.biezhi.weixin.util.SignUtil;
import blade.kit.http.HttpRequest;
import blade.kit.json.JSON;
import blade.kit.json.JSONObject;

public class Test {
	private static final String ITPK_API = "http://i.itpk.cn/api.php";
	
	// 这里的api_key和api_secret可以自己申请一个
	private static final String KEY = "?api_key=13b52e0033109dd0e3a17570a63b9395&api_secret=rgif59isberr";
	
	private static String xiaodoubi(String msg) {
		String url = ITPK_API + KEY + "&question=" + msg;
		String result = HttpRequest.get(HttpRequest.encode(url)).body("utf-8");
		return result;
	}
	
	public static void main(String[] args) {
		String str = xiaodoubi("笑话");
		System.out.println(SignUtil.doSign("笑话",str));
	}
}
